package cn.sanshuilin.kst.system.provider.bean;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author greenlee
 * @version v1.0
 * @create 创建时间: 2017-12-03 18:00
 * Copyright 2017  by 三水林科技有限公司
 **/
@Entity
@Table(name = "Attachment")
public class Attachment implements Serializable {

    private String id;
    private String contentType;
    private String description;
    private Long fileLength;
    private String fileName;
    private String fileNameInDisk;
    private String memberId;
    private Integer needWaterMark;

    private String hiddenID;
    private String webUrl;
    private String videoImgID;
    @Transient
    public String getHiddenID() {
        return hiddenID;
    }
    @Transient
    public String getWebUrl() {
        return webUrl;
    }
    @Transient
    public String getVideoImgID() {
        return videoImgID;
    }

    public void setHiddenID(String hiddenID) {
        this.hiddenID = hiddenID;
    }

    public void setWebUrl(String webUrl) {
        this.webUrl = webUrl;
    }

    public void setVideoImgID(String videoImgID) {
        this.videoImgID = videoImgID;
    }

    @Id
    @Column(name = "ID", nullable = false, length = 32)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "ContentType", nullable = true, length = 255)
    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    @Basic
    @Column(name = "Description", nullable = true, length = 255)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "FileLength", nullable = true)
    public Long getFileLength() {
        return fileLength;
    }

    public void setFileLength(Long fileLength) {
        this.fileLength = fileLength;
    }

    @Basic
    @Column(name = "FileName", nullable = true, length = 255)
    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    @Basic
    @Column(name = "FileNameInDisk", nullable = true, length = 255)
    public String getFileNameInDisk() {
        return fileNameInDisk;
    }

    public void setFileNameInDisk(String fileNameInDisk) {
        this.fileNameInDisk = fileNameInDisk;
    }

    @Basic
    @Column(name = "MemberID", nullable = true, length = 255)
    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    @Basic
    @Column(name = "NeedWaterMark", nullable = true)
    public Integer getNeedWaterMark() {
        return needWaterMark;
    }

    public void setNeedWaterMark(Integer needWaterMark) {
        this.needWaterMark = needWaterMark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Attachment that = (Attachment) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (contentType != null ? !contentType.equals(that.contentType) : that.contentType != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (fileLength != null ? !fileLength.equals(that.fileLength) : that.fileLength != null) return false;
        if (fileName != null ? !fileName.equals(that.fileName) : that.fileName != null) return false;
        if (fileNameInDisk != null ? !fileNameInDisk.equals(that.fileNameInDisk) : that.fileNameInDisk != null)
            return false;
        if (memberId != null ? !memberId.equals(that.memberId) : that.memberId != null) return false;
        if (needWaterMark != null ? !needWaterMark.equals(that.needWaterMark) : that.needWaterMark != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (contentType != null ? contentType.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (fileLength != null ? fileLength.hashCode() : 0);
        result = 31 * result + (fileName != null ? fileName.hashCode() : 0);
        result = 31 * result + (fileNameInDisk != null ? fileNameInDisk.hashCode() : 0);
        result = 31 * result + (memberId != null ? memberId.hashCode() : 0);
        result = 31 * result + (needWaterMark != null ? needWaterMark.hashCode() : 0);
        return result;
    }
}
